﻿<style type="text/css">
    /*理财列表*/
    .finlist-data{margin-top: 42px;}
    .finlist-data li{clear: both;overflow:hidden;border-bottom: 1px solid #eee;padding-bottom: 15px;padding-top: 15px}
    .finlist-data li a{margin-right:15px;display: block;}
    .data-left{ width: 30%;float: left;text-align: center;}
    .data-left p:nth-of-type(2){font-size: 14px;}
    .data-left p{color: #d65659;}
    .data-left p:nth-of-type(1){font-size: 20px;margin-bottom: 5px}

    .data-right{width: 70%;float: left;}
    .data-right h2{font-size: 17px;font-weight: 700;}
    .data-right span{padding: 1px 2px;border: 1px solid #a1a1a1;margin-top: 5px;display: inline-block;color:#a1a1a1;font-size: 14px;margin-right:6px;}
    .data-right span:nth-of-type(1){color:#d65659;border: 1px solid #d65659 }
    /*高亮*/
    .Fin-color{font-weight: 700;border-bottom: 2px solid #000}
    .mv-tabs-double .odr-nava .choose{background:#d65659 !important}
    .mv-tabs-double .odr-navb ul li a{color:#d65659}
    .mv-tabs-double .odr-navb ul li .choose{color:#d65659;border-bottom:1px solid #d65659}
</style>
<div class="mv-tabs-double">
    <a class="odr-fh" onclick="mview.view.load('/views/home/main.html')">
        <i class="iconfont icon-fanhui1"></i>
    </a>
    <div class="odr-nava">
        <a class="choose" onclick="mview.view.load('/views/module/financing/main.html')">在售品种</a><a onclick="mview.view.load('/views/module/financing/itemlists.html')">我的理财</a>
    </div>
    <div class="odr-navb">
        <ul>
            <li v-for="coin in bag.coins">
                <a :class="'odr-navb-a-'+coin.id" v-on:click="choose($event,coin.id)" v-text="coin.code+'区'">-</a>
            </li>
        </ul>
    </div>
</div>
<div class="finlist-data">
    <ul>
        <li v-for="data in bag.datas">
            <a v-on:click="detail(data.id)">
                <div class="data-left">
                    <p v-text="data.avg_rate+'%'">-</p>
                    <p v-if="data.cycle <= 0">活期</p>
                </div>
                <div class="data-right">
                    <h2 v-text="data.title">-</h2>
                    <span v-for="tag in data.tags" v-text="tag">-</span>
                </div>
            </a>
        </li>
    </ul>
</div>
<div style="text-align:center;margin-top:0.5em;" v-if="bag.dataend == false">
    <a v-on:click="more" v-text="morename" style="color:#888;">-</a>
</div>
<div style="text-align:center;margin-top:0.5em;" v-if="bag.dataend == true">
    <a style="color:#aaa;">已显示所有</a>
</div>
<div style="height:60px;"></div>
<script type="text/javascript">
    var pagedata = {
        request: {
            method: "VIEW_FINANCING_MAIN",
            page: 0,
            coin: 1
        },
        screen: {
            header_display: false,
            footer_choose: "user"
        },
        data: {
            morename: "查看更多"
        },
        oncreate: function () {
            m.view.node(".odr-navb-a-" + pagedata.request.coin).addClass("choose");
        },
        methods: {
            detail: function (id) {
                mview.view.load('/views/module/financing/detail.html', {
                    id: id
                });
            },
            choose: function (elm, coin) {
                m.view.node(".odr-navb a").removeClass("choose");
                m.view.node(elm.currentTarget).addClass("choose");
                pagedata.request.page = 0;
                pagedata.request.coin = coin;
                pagedata.reload();
            },
            //加载更多
            more: function () {
                pagedata.request.page += 1;
                mview.socket.send({
                    data: {
                        method: "VIEW_FINANCING_MAIN",
                        page: pagedata.request.page,
                        coin: pagedata.request.coin,
                        part: 1
                    },
                    success: function (json) {
                        if (json.Code == 0 && json.Data.datas.length > 0) {
                            for (var i in json.Data.datas) {
                                var data = json.Data.datas[i];
                                mview.vue.stage.$data.bag.dataend = json.Data.dataend;
                                mview.vue.stage.$data.bag.datas.push(data);
                            }
                        }
                    }
                });
            }
        }
    }
    mview.view.chlid.init(pagedata);
</script>